package com.hx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hx.entity.Courses;
import com.hx.repository.CourseRep;

@Component
public class CourseService {
	@Autowired
	private CourseRep courseRep;

	public List<Courses> getAll(){
		return (List<Courses>) courseRep.findAll();
	}
	//	
	public Courses getOne(Integer id){
		return courseRep.findOne(id);
	}
	   public String getName(Integer courid) {
			return courseRep.findOne(courid).getName();
		}
}
